from fastapi.responses import ORJSONResponse


def make_response(
        code: int = 200,
        message: str = "成功",
        data: dict | list | None = None,
) -> ORJSONResponse:
    """
    统一返回格式，支持快速构造 JSON 响应。
    - code: 状态码，默认200
    - message: 返回信息
    - data: 业务数据，默认空字典

    返回 ORJSONResponse 对象，FastAPI 可直接返回
    """

    content = {
        "code": code,
        "message": message,
        "data": data or {},
    }
    return ORJSONResponse(content=content, status_code=code)
